/**
 * 获取组织架构的数据
 **/
import request from '@/utils/request'
export function getDepartments() {
  return request({
    url: '/company/department',
    method: 'GET'
  })
}

/**
 * 获取删除部门的id
*/
export function deleteDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}

/**
 * 新增部门接口
*/
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

/**
 * 获取部门详情 => 根据ID获取角色详情
*/
export function getDepartDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}

/**
 *  根据id 编辑修改部门详情
*/
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}
